home *** CD-ROM | disk | FTP | other *** search
/ Aminet 28 / Aminet 28 (1998)(GTI - Schatztruhe)[!][Dec 1998].iso / Aminet / dev / src / GLperf3.12-src.lha / GLperf / Image.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-08-01  |  6.5 KB  |  195 lines

  1. /*
  2.  * (c) Copyright 1995, Silicon Graphics, Inc.
  3.  * ALL RIGHTS RESERVED
  4.  * Permission to use, copy, modify, and distribute this software for
  5.  * any purpose and without fee is hereby granted, provided that the above
  6.  * copyright notice appear in all copies and that both the copyright notice
  7.  * and this permission notice appear in supporting documentation, and that
  8.  * the name of Silicon Graphics, Inc. not be used in advertising
  9.  * or publicity pertaining to distribution of the software without specific,
  10.  * written prior permission.
  11.  *
  12.  * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
  13.  * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
  14.  * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
  15.  * FITNESS FOR A PARTICULAR PURPOSE.  IN NO EVENT SHALL SILICON
  16.  * GRAPHICS, INC.  BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
  17.  * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
  18.  * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
  19.  * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
  20.  * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC.  HAS BEEN
  21.  * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
  22.  * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
  23.  * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
  24.  *
  25.  * US Government Users Restricted Rights
  26.  * Use, duplication, or disclosure by the Government is subject to
  27.  * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
  28.  * (c)(1)(ii) of the Rights in Technical Data and Computer Software
  29.  * clause at DFARS 252.227-7013 and/or in similar or successor
  30.  * clauses in the FAR or the DOD or NASA FAR Supplement.
  31.  * Unpublished-- rights reserved under the copyright laws of the
  32.  * United States.  Contractor/manufacturer is Silicon Graphics,
  33.  * Inc., 2011 N.  Shoreline Blvd., Mountain View, CA 94039-7311.
  34.  *
  35.  * Author: John Spitzer, SGI Applied Engineering
  36.  *
  37.  */
  38.  
  39. #if (defined(INC_REASON)) && (INC_REASON == INFO_ITEM_STRUCT)
  40.     int imageWidth;
  41.     int imageHeight;
  42.     int imageFormat;
  43.     int imageType;
  44.     int imageAlignment;
  45.     int imageSwapBytes;
  46.     int imageLSBFirst;
  47. #elif (defined(INC_REASON)) && (INC_REASON == INFO_ITEM_ARRAY)
  48.     {
  49.         ImageFormat,
  50.         "Image Format",
  51.         offset(imageFormat),
  52.         Enumerated,
  53.         {
  54.             { GL_COLOR_INDEX,           "GL_COLOR_INDEX" },
  55.             { GL_STENCIL_INDEX,         "GL_STENCIL_INDEX" },
  56.             { GL_DEPTH_COMPONENT,       "GL_DEPTH_COMPONENT" },
  57.             { GL_RED,                   "GL_RED" },
  58.             { GL_GREEN,                 "GL_GREEN" },
  59.             { GL_BLUE,                  "GL_BLUE" },
  60.             { GL_ALPHA,                 "GL_ALPHA" },
  61.             { GL_LUMINANCE,             "GL_LUMINANCE" },
  62.             { GL_LUMINANCE_ALPHA,       "GL_LUMINANCE_ALPHA" },
  63.             { GL_RGB,                   "GL_RGB" },
  64.             { GL_RGBA,                  "GL_RGBA" },
  65. #ifdef GL_EXT_abgr
  66.             { GL_ABGR_EXT,              "GL_ABGR_EXT" },
  67. #endif
  68.             { End }
  69.         },
  70.         { GL_RGBA }
  71.     },
  72.     {
  73.         ImageType,
  74.         "Image Type",
  75.         offset(imageType),
  76.         Enumerated,
  77.         {
  78.             { GL_BITMAP,                      "GL_BITMAP" },
  79.             { GL_UNSIGNED_BYTE,               "GL_UNSIGNED_BYTE" },
  80.             { GL_BYTE,                        "GL_BYTE" },
  81.             { GL_UNSIGNED_SHORT,              "GL_UNSIGNED_SHORT" },
  82.             { GL_SHORT,                       "GL_SHORT" },
  83.             { GL_UNSIGNED_INT,                "GL_UNSIGNED_INT" },
  84.             { GL_INT,                         "GL_INT" },
  85.             { GL_FLOAT,                       "GL_FLOAT" },
  86. #ifdef GL_EXT_packed_pixels
  87.             { GL_UNSIGNED_BYTE_3_3_2_EXT,     "GL_UNSIGNED_BYTE_3_3_2_EXT" },
  88.             { GL_UNSIGNED_SHORT_4_4_4_4_EXT,  "GL_UNSIGNED_SHORT_4_4_4_4_EXT" },
  89.             { GL_UNSIGNED_SHORT_5_5_5_1_EXT,  "GL_UNSIGNED_SHORT_5_5_5_1_EXT" },
  90.             { GL_UNSIGNED_INT_8_8_8_8_EXT,    "GL_UNSIGNED_INT_8_8_8_8_EXT" },
  91.             { GL_UNSIGNED_INT_10_10_10_2_EXT, "GL_UNSIGNED_INT_10_10_10_2_EXT" },
  92. #endif
  93.             { End }
  94.         },
  95.         { GL_UNSIGNED_BYTE }
  96.     },
  97.     {
  98.         ImageAlignment,
  99.         "Image Alignment",
  100.         offset(imageAlignment),
  101.         Enumerated,
  102.         {
  103.             { 1,                        "1" },
  104.             { 2,                        "2" },
  105.             { 4,                        "4" },
  106.             { 8,                        "8" },
  107.             { End }
  108.         },
  109.         { 4 }
  110.     },
  111.     {
  112.         ImageSwapBytes,
  113.         "Image Swap Bytes",
  114.         offset(imageSwapBytes),
  115.         Enumerated,
  116.         {
  117.             { True,                     "True" },
  118.             { False,                    "False" },
  119.             { End }
  120.         },
  121.         { False }
  122.     },
  123.     {
  124.         ImageLSBFirst,
  125.         "Image LSB First",
  126.         offset(imageLSBFirst),
  127.         Enumerated,
  128.         {
  129.             { True,                     "True" },
  130.             { False,                    "False" },
  131.             { End }
  132.         },
  133.         { False }
  134.     },
  135.     {
  136.         ImageWidth,
  137.         "Image Width",
  138.         offset(imageWidth),
  139.         RangedInteger,
  140.         {
  141.             { 1 },
  142.             { 65536 }
  143.         },
  144.         { 64 }
  145.     },
  146.     {
  147.         ImageHeight,
  148.         "Image Height",
  149.         offset(imageHeight),
  150.         RangedInteger,
  151.         {
  152.             { 1 },
  153.             { 65536 }
  154.         },
  155.         { 64 }
  156.     },
  157. #else  /* INC_REASON not defined, treat as plain include */
  158. #ifndef _Image_h
  159. #define _Image_h
  160.  
  161. #include "General.h"
  162. #include "Print.h"
  163. #include "TestName.h"
  164. #include "PropName.h"
  165. #include "Global.h"
  166. #include "AttrName.h"
  167. #ifdef WIN32
  168. #include <windows.h>
  169. #endif
  170. #include <GL/gl.h>
  171. #include <GL/glu.h>
  172. #include "Random.h"
  173.  
  174. typedef struct _Image {
  175. #define INC_REASON INFO_ITEM_STRUCT
  176. #include "Image.h"
  177. #undef INC_REASON
  178. } Image, *ImagePtr;
  179.  
  180. void new_Image(ImagePtr);
  181. void delete_Image(ImagePtr);
  182. int Image__SetState(ImagePtr);
  183. void* new_ImageData(int width, int height, int format, int type, int alignment, int swapBytes, int lsbFirst, int memAlign, int* size);
  184. GLint* CreateSubImageData(int imageWidth, int imageHeight, int subWidth, int subHeight,
  185.                           float acceptObjs, float rejectObjs, float clipObjs,
  186.                           int clipMode, float percentClip, 
  187.               int spacedDraw,
  188.               int memAlignment,
  189.                           int* numDrawn);
  190. void Image__DrawSomething(int rgba, int indexSize, int Double_Buffer);
  191. void* MakeTexImage(int, int, int, int, int, int, int, int, int, int, int*);
  192.  
  193. #endif /* file not already included */
  194. #endif /* INC_REASON not defined */
  195.